<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改客户</title>
<script src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
         //初始化
         $(document).ready(function(){
        	 
        	 //省
        	 getPro("#pro",0);
        	 //市
        	 $("#pro").change(function(){
            	 var id=$("#pro").val();
            	 getPro("#city",id);
                 $("input[name='city']").val(id);
             });
        	 //区
        	 $("#city").change(function(){
            	 var id=$("#city").val();
            	 getPro("#area",id);
            	 $("input[name='city']").val(id);
             });
        	 $("#area").change(function(){
        		 var id=$("#area").val();
            	 $("input[name='city']").val(id);
             });
         });
         //省市获取
		 function getPro(obj,proId){
			 $.getJSON('proCustomer.action',{'proId':proId},function(data){
				 $(obj).html('<option id="-1">--请选择--</option>');
				 $("#area").html('<option id="-1">--请选择--</option>');
				 for ( var i = 0; i < data.length; i++) {
			         $(obj).append('<option value="'+data[i].id+'">'+data[i].name+'</option>');
				 }
		     });
	     }
         //返回
		 function ret(){
			 history.go(-1);
		   }
        
</script>
<link href="../css/table.css" rel="stylesheet" type="text/css">
</head>
<body>
<s:if test="#request.customer==null">
 <jsp:forward page="update_blank.jsp"></jsp:forward>
</s:if>
<s:elseif test="#request.industrys==null">
 <jsp:forward page="update_blank.jsp"></jsp:forward>
</s:elseif><hr/>
<form action="updateCustomer" method="post" id="form1">
<s:hidden name="customer.custCid"/>
  <table width="500" border="1">
  <tr>
    <td>名称:</td>
    <td><input type="text" name="customer.custName" value="${customer.custName}"></td>
  </tr>
  <tr>
    <td>电话:</td>
    <td><input type="text" name="customer.custTellphone" value="${customer.custTellphone}"></td>
  </tr>
  <tr>
    <td>主页:</td>
    <td><input type="text" name="customer.custWeburl" value="${customer.custWeburl}"></td>
  </tr>
  <tr>
    <td>省市:</td>
    <td><input type="hidden" name="city" value="-1">
        <select id="pro">
           <option id="-1">--请选择--</option>
        </select>
        <select id="city">
           <option id="-1">--请选择--</option>
        </select>
        <select id="area">
           <option id="-1">--请选择--</option>
        </select>
    </td>
  </tr>
  <tr>
    <td>法人代表:</td>
    <td><input type="text" name="customerInfo.cinfoLegal" value="${customerInfo.cinfoLegal}"></td>
  </tr>
  <tr>
    <td>短信:</td>
    <td><input type="text" name="customerInfo.cinfoMessagephone" value="${customerInfo.cinfoMessagephone}"></td>
  </tr>
  <tr>
    <td>传真:</td>
    <td><input type="text" name="customerInfo.cinfoFax" value="${customerInfo.cinfoFax}"></td>
  </tr>
  <tr>
    <td>邮编:</td>
    <td><input type="text" name="customerInfo.cinfoZipcode" value="${customerInfo.cinfoZipcode}"></td>
  </tr>
  <tr>
    <td>地址:</td>
    <td><input type="text" name="customerInfo.cinfoAddress" value="${customerInfo.cinfoAddress}"></td>
  </tr>
  <tr>
    <td>邮箱:</td>
    <td><input type="text" name="customerInfo.cinfoEmail" value="${customerInfo.cinfoEmail}"></td>
  </tr>
  
  <s:select name="industry" list="industrys" listKey="typeId" listValue="typeValue" label="客户行业"></s:select>
  <s:select name="live" list="lives" listKey="typeId" listValue="typeValue" label="客户等级"></s:select>
  <s:select name="nature" list="natures" listKey="typeId" listValue="typeValue" label="客户性质"></s:select>
  <s:select name="ctype" list="ctypes" listKey="typeId" listValue="typeValue" label="客户类型"></s:select>
  <s:select name="source" list="sources" listKey="typeId" listValue="typeValue" label="客户来源"></s:select>
 
  
  <tr>
    <td>备注:</td>
    <td>
      <textarea name="customerInfo.cinfoIntroduction" id="textarea" cols="45" rows="5">${customerInfo.cinfoIntroduction}</textarea>
    </td>
  </tr>
  <tr><td colspan="2"><input type="button" onclick="ret()" value="返回"><input type="submit" value="提交"></td></tr>
</table>
</form>
</body>
</html>